package com.xinqi.modules.mq.rongyun.mq;


import com.xinqi.common.core.enums.RocketMqEnum;
import com.xinqi.common.core.utils.SpringUtils;
import com.xinqi.common.rocketmq.dto.RocketMqBean;
import com.xinqi.modules.mq.rongyun.mq.consumer.RongyunMessageConsumer;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @Author：yyzhen
 * @Package：com.xinqi.modules.chat.mq
 * @Project：xinqi.modules-Cloud-Plus
 * @name：RongyunMessageRunner
 * @Date：2023/8/7 13:40
 * @Filename：RongyunMessageRunner
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class RongyunMessageRunner implements CommandLineRunner {

    private final RocketMqBean rocketMqBean = SpringUtils.getBean(RocketMqBean.class);

    private final RongyunMessageConsumer messageConsumer;

    @Override
    public void run(String... args) throws Exception {
        // 启动融云--消息类 MQ消息监听
        messageConsumer.pushMessageConsumerMsg(rocketMqBean, RocketMqEnum.RONGYUN_MESSAGE);
    }

}
